import Vue from 'vue'
import store from '@/store/index'

Vue.directive('auth', {
  inserted (el, binding) {
    const componentMap = store.getters['auth/componentMap']
    if (componentMap[binding.value] !== true) {
      el.parentNode.removeChild(el)
    }
  }
})
